import request from "@/utils/request";

//企业数和企业分布

export function getRegionVehicleRecords(data) {
  return request({
    url: "/vehicle-web-server/api.v1/regionVehicleRecords/passRecords/page",
    method: "get",
    params: data,
  });
}

export function vehicleBaseInfo(data) {
  return request({
    url: "/vehicle-web-server/api.v1/vehicleBaseInfo/list",
    method: "get",
    params: data,
  });
}

export function findCarTrajectory(data) {
  return request({
    url: "/vehicle-web-server/api.v1/LocationNow/findCarTrajectory",
    method: "get",
    params: data,
  });
}
export function NewCarData(data) {
  return request({
    url: "/vehicle-web-server/api.v1/LocationNow/NewCarData",
    method: "get",
    params: data,
  });
}
export function getCity() {
  return request({
    url: "/vehicle-web-server/api.v1/districts/list",
    method: "get",
  });
}



export function site(data) {
  return request({
    url: "/vehicle-web-server/api.v1/regionInfo/site/list",
    method: "get",
    params:data
  });
}

export function regionInfoList(data) {
  return request({
    url: "/vehicle-web-server/api.v1/regionInfo/list",
    method: "get",
    params:data
  });
}
export function getNewCarRecord(data) {
  return request({
    url: "/vehicle-web-server/api.v1/LocationNow/newRecords/page",
    method: "get",
    params: data,
  });
}

export function getRegionHeatMap(data) {
  return request({
    url: "/vehicle-web-server/api.cyc.pg/v1/regionAnalysis/regions/heatmap",
    method: "get",
    params: data,
  });
}


export function getRegionVehicleRecord(data) {
  return request({
    url: "/vehicle-web-server/api.v1/regionVehicleRecords/newRecords/page",
    method: "get",
    params: data,
  });
}

export function getCompanyByDistrictCode(districtCode) {
  return request({
    url: "/vehicle-web-server/api.v1/regionInfo/list/" + districtCode,
    method: "get",
  });
}
export function getComDataTotalAndPer() {
  return request({
    url: "/vehicle-web-server/api/v1/dashboard/left/top",
    method: "get",
  });
}

//各区企业联网数和联网率
export function getAreaInlineData() {
  return request({
    url: "/vehicle-web-server/api/v1/dashboard/left/middle",
    method: "get",
  });
}


//近一周上报统计
export function getWeekAreaData() {
  return Promise.resolve({
    code: "00000",
    data: [
      {
        name: "昌吉市",
        record: [
          {
            name: "2025-04-11",
            value: 21129,
          },
          {
            name: "2025-04-12",
            value: 10877,
          },
          {
            name: "2025-04-13",
            value: 31290,
          },
          {
            name: "2025-04-14",
            value: 38287,
          },
          {
            name: "2025-04-15",
            value: 32723,
          },
          {
            name: "2025-04-16",
            value: 15269,
          },
          {
            name: "2025-04-17",
            value: 28985,
          },
        ],
      },

      {
        name: "阜康市",
        record: [
          {
            name: "2025-04-11",
            value: 1100,
          },
          {
            name: "2025-04-12",
            value: 1311,
          },
          {
            name: "2025-04-13",
            value: 1000,
          },
          {
            name: "2025-04-14",
            value: 1500,
          },
          {
            name: "2025-04-15",
            value: 1211,
          },
          {
            name: "2025-04-16",
            value: 1111,
          },
          {
            name: "2025-04-17",
            value: 1230,
          },
        ],
      },
    ],
    msg: "一切ok",
  });

  // return request({
  // 	url: '/vehicle-web-server/api/v1/dashboard/left/bottom',
  // 	method: 'get',
  // });
}

export function getWeekCarTypeData() {
  return Promise.resolve({
    code: "00000",
    data: [
      {
        name: "国四及以下",
        record: [
          {
            name: "2025-04-11",
            value: 12301,
          },
          {
            name: "2025-04-12",
            value: 10877,
          },
          {
            name: "2025-04-13",
            value: 11451,
          },
          {
            name: "2025-04-14",
            value: 11412,
          },
          {
            name: "2025-04-15",
            value: 12345,
          },
          {
            name: "2025-04-16",
            value: 15269,
          },
          {
            name: "2025-04-17",
            value: 18985,
          },
        ],
      },

      {
        name: "国五",
        record: [
          {
            name: "2025-04-11",
            value: 11230,
          },
          {
            name: "2025-04-12",
            value: 21401,
          },
          {
            name: "2025-04-13",
            value: 32415,
          },
          {
            name: "2025-04-14",
            value: 12341,
          },
          {
            name: "2025-04-15",
            value: 21111,
          },
          {
            name: "2025-04-16",
            value: 12411,
          },
          {
            name: "2025-04-17",
            value: 12314,
          },
        ],
      },
    ],
    msg: "一切ok",
  });

  // return request({
  // 	url: '/vehicle-web-server/api/v1/dashboard/left/bottom',
  // 	method: 'get',
  // });
}
export function searchTJ(data){
  return request({
    url: "/vehicle-web-server/api.v1/visualization/searchTJ",
    method: "get",
    params: data,
  })
}
export function get24HourCar(data){
  return request({
    url: "/vehicle-web-server/api.v1/districts/get24HourCar",
    method: "get",
    params: data,
  })
}

//上报数和前多少名
export function getReportDataAndTop(data) {
  return request({
    url: "/vehicle-web-server/api.v1/visualization/CountByQy",
    method: "get",
    params: data,
  });
}

//获取排放阶段统计数据
export function getStageData() {
  return Promise.resolve({
    code: "00000",
    data: [
      {
        name: "国Ⅲ",
        value: 10,
      },
      {
        name: "国Ⅳ",
        value: 200,
      },
      {
        name: "国Ⅴ",
        value: 10000,
      },
      {
        name: "国Ⅵ",
        value: 4000,
      },
      {
        name: "电动",
        value: 1000,
      },
      {
        name: "无排放阶段",
        value: 100,
      },
    ],
    msg: "一切ok",
  });
  // return request({
  // 	url: '/vehicle-web-server/api/v1/dashboard/right/middle',
  // 	method: 'get',
  // });
}

//车辆预警数据
export function getWarningCarData() {
  return request({
    url: "/vehicle-web-server/api/v1/dashboard/right/bottom/vehicleAlarm",
    method: "get",
  });
}

//企业预警数据
export function getWarningComData(data) {
  return request({
    url: "/vehicle-web-server/api.v1/regionInfo/enterpriseMonitoring/counts/alarms",
    method: "get",
    params: data,
  });
}

//地图上企业列表
export function getMapComData() {
  return request({
    url: "/vehicle-web-server/api/v1/dashboard/left/center",
    method: "get",
  });
}
